1 using UnityEngine;
2 using
System.Collections;
3
4 public
class ScoreAbsorber : MonoBehaviour {
5     
public int score;
6
7     
// Use this for initialization
8     
void Start () {
9         ScoreKeeper oldKeeper = FindObjectOfType<ScoreKeeper>();
10         score =
1;
11
12         
if (oldKeeper)
13         {
14             score = oldKeeper.score;
15             Destroy(oldKeeper.gameObject);
16         }
17     }
18     
19     
// Update is called once per frame
20     
void Update () {
21     
22     }
23 }


Gõ tìm kiếm nhanh...